import { useNavigate } from "react-router-dom";
import styles from './index.module.scss'
import { LeftOutline } from 'antd-mobile-icons'

export default function Navbar ({children,extra}) {
    let navigate = useNavigate()
    const back = () => {
        navigate(-1)
    }
    return (
        <div className={styles.root}>
      {/* 左侧 */}
      <div className="left">
        <LeftOutline onClick={back} />
      </div>

      {/*居中标题 */}
      <div className="title">{children}</div>

      {/* 右侧 */}
      <div className="right">{extra}</div>
    </div>
    )
}